SPSS tips for analyzing interactions in regression
(with reference to HW6s08)

to center a variable:

1) Compute its mean by running a regression including all your main predictors (no interactions yet), SOLELY for the purpose of clicking on "statistics" and checking the "descriptives" box. The reason you should get the descriptives through the Regression menu instead of just going to the Descriptive Statistics menu is that the Regression option will base it only on the number of subjects who have complete data to be used in the regression (ie those who also have scores on "frequency of cancer thoughts" and "afterlife belief"), while the descriptive stats will compute the mean of as many "meaning1" scores as there are. In the first part of this assignment, there are 241 "meaning1" scores (w/ mean of 22.9378), but only 235 of those subjects are included in your regression (w/ mean of 22.8638). It's a tiny difference here but in other cases it might be substantial.

2) Once you've computed the mean, go to Transform -> Compute, and put the name of your new centered variable in the "target variable" box (e.g., "cmean1" as suggested on the homework). Then in the "numeric expression" box put the original version minus whatever its mean is (e.g., "facitmp1-22.8638"). The new variable will have a mean of zero, with the exact same standard deviation as the original. Use the new version when you now do the regression for real, to create your product terms. You can also use the centered version in place of the original version in the first stage of the sequential regression -- it will change the intercept but not the b-weights (since centering just shifts the distribution by a constant!). For consistency and to avoid errors, it probably is a good idea to substitute the centered version for the original version at every occurrence.

to create dummy variables, or effect-coded or otherwise (depending on choice of values); note this has already been done for you in the homework -- you can see why -- but you may need to do it yourself sometime:

1) Go to Transform -> Recode -> Into Different Variables. Click the categorical variable into the box ("Afterlife Belief" on the homework). Type a name for the first coded variable in the Output Variable box, such as "dummy1", or "nonbel" as was chosen in the homework. A label is optional, such as "nonbelief in afterlife." Then click "Change."

2) Write down the codes you're using in each of your dummy variables so you know what to enter in the next step. For instance, on the dummy variable "nonbel", "afterbel" category 1 (nonbelief) will become 1 while categories 2 (unsure) and 3 (certain) will be 0; on the dummy variable "unsure", "afterbel" category 2 will become "1" while categories 1 and 3 are 0; on the dummy variable "certain", category 3 will become 1 while 1 and 2 are 0. To represent three categories, only two dummy variables are needed, so really you need only create any two of these. I described all three for illustration, which is likewise why all three are included in your data file.

3) Click on "Old and New Values" and type the first value of the categorical variable into the Old slot (eg "1" on "afterbel"), and its corresponding value on the dummy variable into the New slot (eg "1" on "nonbel"). Then click "Add" below that. Type the next categorical value ("2" on "afterbel") in the Old slot and its dummy value in the New slot ("0" on "nonbel"), and click "Add." Then type the third categorical value ("3" on "afterbel") in the Old slot and its dummy value in the New slot ("0" on "nonbel"), and click "Add." Click "Continue," and "Okay."

4) Repeat step 1 for the second dummy variable, which in the homework is called "unsure." For each of the categorical "afterbel" Old values 1, 2, and 3, select the code you wrote down in step 2 for the second dummy variable. Repeat this again for the third dummy variable if you like, though you don't need it to represent your three categories. But do be sure to create (#groups-1) dummy variables to use in the regression.

5) If you're using effect coding or orthogonal coding or any other scheme, just identify the appropriate values for yourself in step 2, and use those as your New values.

to create product vectors / variables:

1) Center the continuous variables that will be involved in the interaction. You do NOT have to center dummy variables.

2) Go to Transform -> Compute, make up a name for your interaction product variable, and put it in the "target variable" box. It may be useful to click "Type & Label" and enter an easily understood label, since keeping track of which versions of which variables are being multiplied might get burdensome with just 8 characters in an SPSS variable name. Then in the "numeric expression" box put one interacting variable times the other, and click "Okay."

3) If the interaction is between two continuous variables, there's just the one product variable to make. If the interaction is between a continuous and a categorical variable, you have to make the product between the centered continuous variable and EACH of the dummy variables you include, e.g., centered "meaning1" times the "unsure" dummy variable ("cmean1*unsure") AND centered "meaning1" times the "certain" dummy variable ("cmean1*certain"). In that case there will be as many product variables as there are dummy variables. If the interaction is between two categorical variables, each dummy variable representing the first categorical variable must be multiplied by each dummy variable representing the second categorical variable. In the case of a 3-level factor interacting with a 4-level factor, you would need 2 dummy variables for the first and 3 for the second, and would have to make a total of 6 product variables (dummies 1*1, 1*2, 1*3, 2*1, 2*2, and 2*3). Notice that this corresponds to the 6 degrees of freedom you'd expect from the ANOVA version of this interaction term: a 3 by 4 interaction has df = (3-1) * (4-1).